import requests
headers ={
        'User-Agent' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36'
    }
urls = [
    'http://xmdx.sc.chinaz.net/Files/DownLoad/jianli/201904/jianli10231.rar'
    'http://zjlt.sc.chinaz.net/Files/DownLoad/jianli/201904/jianli10229.rar'
    'http://xmdx.sc.chinaz.net/Files/DownLoad/jianli/201904/jianli10231.rar'
]
#封装一个函数，获取响应对象的url
def get_context(url):
    print('正在爬取',url)
    response = requests.get(url=url,headers=headers)#爬取指定参数的url
    if response.status_code ==200 :#查看响应状态码，如果等于200，响应成功
        return response.content
#封装一个函数，用于数据解析
def paesr_content(content):
    #模拟解析的耗时操作
    print('响应数据的长度为：',len(content))
#遍历列表
for url in urls:
    content = get_context(url)#调用get_content传入遍历的url
    paesr_content(content)